package com.third.bank.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.third.bank.Dto.InterestRateInfo;
import com.third.bank.entity.InterestInfo;
import com.third.bank.mapper.InterestInfoMapper;
import com.third.bank.service.InterestInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * 利率信息表serviceimpl
 */
@Service
public class InterestInfoServiceimpl extends ServiceImpl<InterestInfoMapper, InterestInfo> implements InterestInfoService {
    @Autowired
    private InterestInfoMapper interestInfoMapper;

    @Override
    public InterestRateInfo getCurrentInterestRate(LocalDateTime now) {

        return interestInfoMapper.getCurrentInterestRate(now.getYear());
    }
}
